<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="black" name="apple-mobile-web-app-status-bar-style">
        <title>订单详情</title>
        <script src="__JS__/zepto.min.js"></script>
        <link href="__CSS__/weui.min.css" rel="stylesheet">
        <link rel="stylesheet" href="__SALEMAN__/stylesheets/index.css">
    </head>
    <body>
        <div class="orderInfo">
            <header class = "all_header">
                <a class = "h_back h_back_1" href="/Home/Saleman/Saleman/clinicOrder"><img src="__SALEMAN__/images/back_icon.png" alt=""></a>
                <span class = "h_title">订单详情</span>
                <a class = "h_add" href="javascript:void(0);"></a>
            </header>
            <div class="order">
                <div class="order_adress">
                    <a class = "adress_icon" href="javascript:void(0)"><img src="__SALEMAN__/images/order_adress.png" alt=""></a>
                    <span>{$order['address']}</span>
                </div>
                <volist name="orderDetailList" id="orderDetailVo">
                    <div class="order_list">
                        <div class="order_name_w">
                            <span class = "order_name">{$orderDetailVo['drugs_name']}</span>
                        </div>
                        <div class="order_price_w">
                            <span class = "order_w">单价</span>
                            <span>¥{$orderDetailVo['price']}</span>
                        </div>
                        <div class="order_count">X{$orderDetailVo['num']}</div>
                        <div class="all_price_w">
                            <span class = "order_w">总价</span>
                            <span>¥<i class = "all_num">{$order['total_price']}</i></span>
                        </div>
                    </div>
                </volist>
                <div class="total_price_w">
                    <span class = "total_name">商品总额：</span>
                    <span><i class = "total_num">¥{$order['total_price']}</i></span>
                </div>
            </div>       
            <if condition="$order['status'] neq '1'">
            	<div class="weui-btn-area">
               		 <a class="weui-btn total_btn btn_status" href="javascript:" pos_title="确定此订单完成？" pos_id="{$order['id']}" pos_status="1">完成</a>
            	</div>
            <else/>
            </if>
            
        </div>
    <include file="./Application/Home/View/default/Saleman/Public/popup.html"/>
    <script src = "__SALEMAN__/js/index.js"></script>
    <script src = "__SaleManager__/js/androidback.js"></script>
    <script>
        $('.btn_status').on('click', function () {
            var title = $(this).attr('pos_title');
            $('.confir_content').html(title);
            $("#iosDialog1").show(200);
        });
        $('.ok-btn').on('click', function () {
            var id = $('.btn_status').attr('pos_id');
            var status = $('.btn_status').attr('pos_status');
            $.ajax({
                url: "/Home/Saleman/Saleman/orderInfo",
                type: 'post',
                data: {id: id, status: status},
                cache: false,
                dataType: "json",
                success: function (result) {
                    $("#iosDialog1").hide(200);
                    $('#iosDialog2').find('.sure-info').html(result['msg']);
                    $('#iosDialog2').show(200);
                }
            });
        });
    </script>
</body>
</html>